import { Entity,PrimaryGeneratedColumn,Column,CreateDateColumn, UpdateDateColumn } from "typeorm";
import { BaseEntity } from "src/entities/base.entity";

@Entity()
export class Menu extends BaseEntity{
    @PrimaryGeneratedColumn({
        type:"bigint"
    })
    menu_id:number

    @Column({
        length:50,
        comment:"菜单名称"
    })
    menu_name:string

    @Column({
        type:"bigint",
        default:0,
        nullable:true,
        comment:"父菜单ID"
    })
    parent_id:number

    @Column({
        type:"int",
        default:0,
        nullable:true,
        comment:"显示顺序"
    })
    order_num:number

    @Column({
        type:"varchar",
        default:'',
        length:200,
        nullable:true,
        comment:"路由地址"
    })
    path:string

    @Column({
        type:"varchar",
        length:255,
        nullable:true,
        comment:"组件路径"
    })
    component:string

    @Column({
        type:"varchar",
        length:255,
        nullable:true,
        comment:"路由参数"
    })
    query:string

    @Column({
        type:"int",
        nullable:true,
        default:1,
        comment:"是否为外链（0是 1否）"
    })
    is_frame:number

    @Column({
        type:"int",
        nullable:true,
        default:0,
        comment:"是否缓存（0缓存 1不缓存）"
    })
    is_cache:number

    @Column({
        type:"char",
        nullable:true,
        length:1,
        default:'',
        comment:"菜单类型（M目录 C菜单 F按钮）"
    })
    menu_type:string

    @Column({
        type:"char",
        nullable:true,
        length:1,
        default:'0',
        comment:"菜单状态（0显示 1隐藏）"
    })
    visible:string

    @Column({
        type:"char",
        nullable:true,
        length:1,
        default:'0',
        comment:"菜单状态（0正常 1停用）"
    })
    status:string

    @Column({
        type:"varchar",
        nullable:true,
        length:100,
        comment:"权限标识"
    })
    perms:string

    @Column({
        type:"varchar",
        nullable:true,
        default:'',
        length:100,
        comment:"菜单图标"
    })
    icon:string
}
